package com.micro.frog.fortune.sdk.cwl.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * 彩票类型
 *
 * @author Jason.lv
 * @since 2022/2/22 11:30
 */
public enum CwlEnum {
    /**
     * 彩票名
     * ssq: 双色球
     * kl8: 快乐8
     * 3d:  福彩3D
     * qlc: 七乐彩
     */
    ssq("ssq", "双色球"),
    kl8("kl8", "快乐8"),
    c3d("3d", "福彩3D"),
    qlc("qlc", "七乐彩"),
    ;

    @Getter
    @EnumValue
    private final String code;
    @Getter
    private final String desc;

    CwlEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CwlEnum getByCode(String code){
        for (CwlEnum anEnum : values()) {
            if (anEnum.code.equals(code)){
                return anEnum;
            }
        }
        return null;
    }
}
